Excel BI - Excel Challenge 716

excel-challenges
excel-formulas
🔰 Words Key Answer Expected battle kj{{rn armament cxvdsgt} casualty kgvyirw} annihilation
Published

March 24, 2026

Illustration for Excel BI - Excel Challenge 716

Challenge Description

🔰 Words Key Answer Expected battle kj{{rn armament cxvdsgt} casualty kgvyirw} annihilation

Solutions

library(tidyverse)
library(readxl)

path = "Excel/700-799/716/716 Key Cipher.xlsx"
input = read_excel(path, range = "A1:B10")
test = read_excel(path, range = "C1:C10")

encrypt = function(word, key) {
  chars = utf8ToInt(word)
  km = str_split(key, "", simplify = TRUE) %>% as.integer()
  kr = rep(km, length.out = length(chars))
  intToUtf8(chars + kr)
}

result = input %>%
  mutate(encrypted = map2_chr(Words, Key, encrypt))

all.equal(result$encrypted, test$`Answer Expected`)
#> [1] TRUE
  • Logic: Read the workbook ranges needed for the challenge; Derive the required intermediate columns; Parse the packed text or string structure.
  • Strengths: The code maps the workbook rule into a compact, reproducible pipeline.
  • Areas for Improvement: The solution assumes the workbook layout and selected ranges remain stable, so any structural change in the sheet would require small adjustments.
  • Gem: The elegant part is how little code is needed once the correct intermediate representation is chosen.
import pandas as pd

path = "700-799/716/716 Key Cipher.xlsx"
input_df = pd.read_excel(path, usecols="A:B", nrows=10)
test_df = pd.read_excel(path, usecols="C", nrows=10)

input_df['encrypted'] = [
    ''.join(chr(ord(c) + int(k)) for c, k in zip(word, str(key) * len(word)))
    for word, key in zip(input_df['Words'], input_df['Key'])
]

result = input_df['encrypted'].tolist() == test_df.iloc[:, 0].tolist()
print(result)

The Python version keeps the algorithm explicit, which helps when the challenge depends on a greedy or iterative rule.

Difficulty Level

Easy / Medium

The business rule is clear, though the workbook still needs a few transformation steps to reach the expected output.